package cz.muni.fi.android.assistivecamera;

import cz.muni.fi.android.assistivecamera.texttospeech.SpeechHandler;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.Button;
import android.widget.TextView;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;

public class ObjectLocatorActivity extends Activity {
	
	private TextView building;
	private static final String TAG = "ObjectLocatorActivity";
	
	public void onCreate(Bundle savedInstanceState){
		super.onCreate(savedInstanceState);
		setContentView(R.layout.search);
		Button ok = (Button) findViewById(R.id.button1);
		Button cancel = (Button) findViewById(R.id.button2);
		building=(TextView)findViewById(R.id.building);
		SpeechHandler.ttsQueue(getResources().getString(R.string.searchBuilding),1 , 1);
		Log.d(TAG,"TTS: "+ R.string.searchBuilding);
		ok.setOnClickListener(new OnClickListener(){

			@Override
			public void onClick(View v) {
				String building = ObjectLocatorActivity.this.building.getText().toString();
				Intent result = new Intent();
				result.putExtra("Building", building);
				setResult(RESULT_OK,result);
				finish();
			}
			
		});
		
		cancel.setOnClickListener(new OnClickListener(){

			@Override
			public void onClick(View v) {
				finish();
			}
			
		});
	}
	
	
}
